package com.open.capacity.service.impl;

import com.open.capacity.common.entity.RegionModel;
import com.open.capacity.mapper.AddressMapper;
import com.open.capacity.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;

    @Override
    public List<RegionModel> GetAllProvince() {
        return addressMapper.GetAllProvince();
    }

    @Override
    public List<RegionModel> GetAreaByID(Integer id) {
        return addressMapper.GetAreaByID(id);
    }

    @Override
    public List<RegionModel> GetCountyByID(Integer id) {
        return addressMapper.GetCountyByID(id);
    }

    @Override
    public List<RegionModel> GetProvinceByUserID(Integer id) {
        return addressMapper.GetAllAddressByID(id);
    }

    @Override
    public List<RegionModel> GetAreaByUserID(Integer id) {
        return addressMapper.GetAreaByUserID(id);
    }

    @Override
    public List<RegionModel> GetCountyByUserID(Integer id) {
        return addressMapper.GetCountyByUserID(id);
    }
}
